#include "../stdafx.h"
#include "ConcreteGamePrototype.h"


namespace Model{


	ConcreteGamePrototype* ConcreteGamePrototype::clone()
	{
		return NULL;
	}
	int ConcreteGamePrototype::addColor(string name)
	{
		int nextAvailableId=0;
		while(this->colors.find(nextAvailableId) != this->colors.end()){
			nextAvailableId++;
		}

		if (nextAvailableId>=NUM_MAX_PLAYER){
			DWRITE("/!\\ An exception is beeing thrown away in ConcreteGamePrototype");
			throw new IllegalOperation("Impossible Operation, Can not register any new Color ");
			
		}
		this->colors.insert(make_pair(nextAvailableId,new Color(name)));
		return (nextAvailableId);
	}
	void ConcreteGamePrototype::preGame()
	{
	}
	ConcreteGamePrototype::ConcreteGamePrototype(void)
	{
	}

	ConcreteGamePrototype::~ConcreteGamePrototype(void)
	{
	}

	void ConcreteGamePrototype::removeColor(int id){
		this->colors.erase(this->colors.find(id));
}
}